import Http from '../http'

interface VotePublish {
    content : string;
    options : {image : string; text : string}[];
}

export async function publishApi(params:VotePublish) {
    return Http.post('publish', params)
}

export async function getUserVoteListPageApi(params:any) {
    let res = await Http.get('vote', params)
    return res.data ? res.data : []
}

export function getVoteApi(id:number) {
    return Http.get('vote/detail', { id })
}

export function voteApi(optionId:number) {
    return Http.post('vote/vote', { optionId })
}